34 research outputs found

    Object-oriented implementations of the MPDATA advection equation solver in C++, Python and Fortran

    Full text link
    Three object-oriented implementations of a prototype solver of the advection equation are introduced. The presented programs are based on Blitz++ (C++), NumPy (Python), and Fortran's built-in array containers. The solvers include an implementation of the Multidimensional Positive-Definite Advective Transport Algorithm (MPDATA). The introduced codes exemplify how the application of object-oriented programming (OOP) techniques allows to reproduce the mathematical notation used in the literature within the program code. A discussion on the tradeoffs of the programming language choice is presented. The main angles of comparison are code brevity and syntax clarity (and hence maintainability and auditability) as well as performance. In the case of Python, a significant performance gain is observed when switching from the standard interpreter (CPython) to the PyPy implementation of Python. Entire source code of all three implementations is embedded in the text and is licensed under the terms of the GNU GPL license

    libcloudph++ 0.2: single-moment bulk, double-moment bulk, and particle-based warm-rain microphysics library in C++

    Full text link
    This paper introduces a library of algorithms for representing cloud microphysics in numerical models. The library is written in C++, hence the name libcloudph++. In the current release, the library covers three warm-rain schemes: the single- and double-moment bulk schemes, and the particle-based scheme with Monte-Carlo coalescence. The three schemes are intended for modelling frameworks of different dimensionality and complexity ranging from parcel models to multi-dimensional cloud-resolving (e.g. large-eddy) simulations. A two-dimensional prescribed-flow framework is used in example simulations presented in the paper with the aim of highlighting the library features. The libcloudph++ and all its mandatory dependencies are free and open-source software. The Boost.units library is used for zero-overhead dimensional analysis of the code at compile time. The particle-based scheme is implemented using the Thrust library that allows to leverage the power of graphics processing units (GPU), retaining the possibility to compile the unchanged code for execution on single or multiple standard processors (CPUs). The paper includes complete description of the programming interface (API) of the library and a performance analysis including comparison of GPU and CPU setups.Comment: The library description has been updated to the new library API (i.e. v0.1 -> v0.2 update). The key difference is that the model state variables are now mixing ratios as opposed to densities. The particle-based scheme was supplemented with the "particle recycling" process. Numerous editorial corrections were mad

    Three hundredth anniversary of Rigisches rechenbuch by Johann Wolck

    Get PDF
    Despite the handbooks on accounting and merchant arithmetics edited in Gdansk, many manuals in this field of foreign origin were used. One of them was a book by Johann Wolck entitled Rigisches Rechenbuch worinnen nach der neusten und besten Art... (the real principles of accounting as a noble art of bookkeeping) edited in George Matthias Noller\u27s printing house in Riga in 1687

    An Improved Perturbation Pressure Closure for Eddy-Diffusivity Mass-Flux Schemes

    Get PDF
    Convection parameterizations such as eddy-diffusivity mass-flux (EDMF) schemes require a consistent closure formulation for the perturbation pressure, which arises in the equations for vertical momentum and turbulence kinetic energy (TKE). Here we derive an expression for the perturbation pressure from approximate analytical solutions for 2D and 3D rising thermal bubbles. The new closure combines a modified pressure drag and virtual mass effects with a new momentum advection term. This momentum advection is an important source in the lower half of the thermal bubble and at cloud base levels in convective systems. It represents the essential physics of the perturbation pressure, that is, to ensure the 3D non-divergent properties of the flow. Moreover, the new formulation modifies the pressure drag to be inversely proportional to updraft depth. This is found to significantly improve simulations of the diurnal cycle of deep convection, without compromising simulations of shallow convection. It is thus a key step toward a unified scheme for a range of convective motions. By assuming that the pressure only redistributes TKE between plumes and the environment, rather than vertically, a closure for the velocity pressure-gradient correlation is obtained from the perturbation pressure closure. This novel pressure closure is implemented in an extended EDMF scheme and is shown to successfully simulate a rising bubble test case as well as shallow and deep convection cases in a single column model

    A Generalized Mixing Length Closure for Eddy-Diffusivity Mass-Flux Schemes of Turbulence and Convection

    Get PDF
    Because of their limited spatial resolution, numerical weather prediction and climate models have to rely on parameterizations to represent atmospheric turbulence and convection. Historically, largely independent approaches have been used to represent boundary layer turbulence and convection, neglecting important interactions at the subgrid scale. Here we build on an eddy鈥恉iffusivity mass鈥恌lux (EDMF) scheme that represents all subgrid鈥恠cale mixing in a unified manner, partitioning subgrid鈥恠cale fluctuations into contributions from local diffusive mixing and coherent advective structures and allowing them to interact within a single framework. The EDMF scheme requires closures for the interaction between the turbulent environment and the plumes and for local mixing. A second鈥恛rder equation for turbulence kinetic energy (TKE) provides one ingredient for the diffusive local mixing closure, leaving a mixing length to be parameterized. Here, we propose a new mixing length formulation, based on constraints derived from the TKE balance. It expresses local mixing in terms of the same physical processes in all regimes of boundary layer flow. The formulation is tested at a range of resolutions and across a wide range of boundary layer regimes, including a stably stratified boundary layer, a stratocumulus鈥恡opped marine boundary layer, and dry convection. Comparison with large eddy simulations (LES) shows that the EDMF scheme with this diffusive mixing parameterization accurately captures the structure of the boundary layer and clouds in all cases considered

    Unified Entrainment and Detrainment Closures for Extended Eddy-Diffusivity Mass-Flux Schemes

    Get PDF
    We demonstrate that an extended eddy鈥恉iffusivity mass鈥恌lux (EDMF) scheme can be used as a unified parameterization of subgrid鈥恠cale turbulence and convection across a range of dynamical regimes, from dry convective boundary layers, through shallow convection, to deep convection. Central to achieving this unified representation of subgrid鈥恠cale motions are entrainment and detrainment closures. We model entrainment and detrainment rates as a combination of turbulent and dynamical processes. Turbulent entrainment/detrainment is represented as downgradient diffusion between plumes and their environment. Dynamical entrainment/detrainment is proportional to a ratio of a relative buoyancy of a plume and a vertical velocity scale, that is modulated by heuristic nondimensional functions which represent their relative magnitudes and the enhanced detrainment due to evaporation from clouds in drier environment. We first evaluate the closures off鈥恖ine against entrainment and detrainment rates diagnosed from large eddy simulations (LESs) in which tracers are used to identify plumes, their turbulent environment, and mass and tracer exchanges between them. The LES are of canonical test cases of a dry convective boundary layer, shallow convection, and deep convection, thus spanning a broad rangeof regimes. We then compare the LES with the full EDMF scheme, including the new closures, in a single鈥恈olumn model (SCM). The results show good agreement between the SCM and LES in quantities that are key for climate models, including thermodynamic profiles, cloud liquid water profiles, and profiles of higher moments of turbulent statistics. The SCM also captures well the diurnal cycle of convection and the onset of precipitation

    PySDM v1 : particle-based cloud modeling package for warm-rain microphysics and aqueous chemistry

    Get PDF
    PySDM is an open-source Python package for simulating the dynamics of particles undergoing condensational and collisional growth, interacting with a fluid flow and subject to chemical composition changes. It is intended to serve as a building block for process-level as well as computational-fluid-dynamics simulation systems involving representation of a continuous phase (air) and a dispersed phase (aerosol), with PySDM being responsible for representation of the dispersed phase. The PySDM package core is a Pythonic high-performance implementation of the Super-Droplet Method (SDM) Monte-Carlo algorithm for representing collisional growth, hence the name. PySDM has two alternative parallel number-crunching backends available: multi-threaded CPU backend based on Numba and GPU-resident backend built on top of ThrustRTC. The usage examples are built on top of four simple atmospheric cloud modelling frameworks: box, adiabatic parcel, single-column and 2D prescribed flow kinematic models. In addition, the package ships with tutorial code depicting how PySDM can be used from Julia and Matlab

    Genetic and Functional Diversity of Bacterial Microbiome in Soils With Long Term Impacts of Petroleum Hydrocarbons

    Get PDF
    Soil contamination with petroleum, especially in the area of oil wells, is a serious environmental problem. Restoring soil subjected to long-term pollution to its original state is very difficult. Under such conditions, unique bacterial communities develop in the soil that are adapted to the contaminated conditions. Analysis of the structure and function of these microorganisms can be a source of valuable information with regard to bioremediation. The aim of this study was to evaluate structural and functional diversity of the bacterial communities in soils with long-term impacts from petroleum. Samples were taken from the three oldest oil wells at the Crude Oil Mine site in W臋gl贸wka, Poland; the oldest was established in 1888. They were collected at 2 distances: (1) within a radius of 0.5 m from the oil wells, representing soil strongly contaminated with petroleum; and (2) 3 m from the oil wells as the controls. The samples were analyzed by 16S rRNA sequencing and the community level physiological profiling (CLPP) method in order to better understand both the genetic and functional structure of soil collected from under oil wells. Significant differences were found in the soil samples with regard to bacterial communities. The soils taken within 0.5 m of the oil wells were characterized by the highest biodiversity indexes. Alphaproteobacteria, Betaproteobacteria, Gammaproteobacteria were strongly correlated with biological activity in these soils. Families of Alphaproteobacteria were also dominant, including: Bradyrhizobiaceae, Rhizobiaceae, Rhodobacteraceae, Acetobacteraceae, Hyphomicrobiaceae, and Sphingomonadaceae. The study showed that the long term contamination of soil changes bacterial communities and their metabolic activity. Even so, natural bioremediation leads to the formation of specific groups of bacteria that actively grow at the site of contamination in the soil
    corecore